/*
 * CarState.h
 *
 */
#ifndef __CARSTATE_H_
#define __CARSTATE_H_

#ifdef  __cplusplus
extern "C" {
#endif		/* __cplusplus */
	
#define STATE_MOVING			1
#define STATE_MOVINE_SLOWLY		2
#define STATE_STOP				3
#define STATE_NO_CAN			4
#define STATE_GYRO				5
#define STATE_ACC				6
#define STATE_GSPEED_30_LESS	7
#define STATE_GSPEED_200_MORE	8
#define STATE_GSPEED_MIDDLE		9
#define STATE_NO_GPS			10
#define STATE_GYRO_UP_LIMIT		11
#define STATE_GYRO_DOWN_LIMIT	12
#define STATE_ACC_UP_LIMIT		13
#define STATE_ACC_DOWN_LIMIT	14
#define STATE_STOP_WAIT			15
#define STATE_MOVE_WAIT			16
	

extern unsigned char gCar_state;
extern double gAngle45;
extern double gAngleGsin;
extern unsigned char sCar_state_display;
extern double angle_VD;
extern double gAngle_Smooth;
extern double gAngle_Final;
extern unsigned char gSpeed_change;
extern unsigned char gFlat_state;
extern double gMorris_Angle;
	
	
void Car_State_Init_Task(void);


void Albert_Init_Task(void);
double F_AngleGsin(void);
double F_Angle45(void);
double F_AngleSH(void);
double F_AngleVD(void);
void Calc_Road_Grade(void);
void F_AngleSmooth(void);
void F_FlatsFilter(void);
	

#define FLAT_STATE_FLAT		0
#define FLAT_STATE_UP		1
#define FLAT_STATE_DOWN		2

#define SPEED_STATE_NORMAL		0
#define SPEED_STATE_MOVING		1
#define SPEED_STATE_STOPING		2


double F_RollAngleGsin(void);
double F_PitchAngleGsin(void);


#ifdef __cplusplus
}
#endif	/* __cplusplus */
#endif	/* __CARSTATE_H_ */